/**
 * 路由堆栈维护
 */
const routeKey = 'routeMap'
const routeMap = sessionStorage.getItem(routeKey) ? JSON.parse(sessionStorage.getItem(routeKey)) : {}

export function setRouteMap(code, pRoute) {
  routeMap[code] = pRoute
  sessionStorage.setItem(routeKey, JSON.stringify(routeMap))
}

export function getPRoute(code) {
  return routeMap[code] || {}
}
